<template>
 
   <!-- @change="countChanged" ref="numbox" -->
  <div class="mui-numbox" data-numbox-min='1'>
    <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
    <input id="test" class="mui-input-numbox" type="number" value="1" @change="countChange" ref="nobox"/>
    <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  </div>
</template>
<script>
import mui from '../../lib/mui/js/mui.min.js' 
export default {
    
  data() {
    return {
      property: "value"
    };
  },
  methods: {
    countChange() {
      //父组件向子组件传值
      console.log("goodsinfo_nobox = "+ this.$refs.nobox.value);
      this.$emit('func', parseInt(this.$refs.nobox.value));
    }
  },
   mounted(){
    mui('.mui-numbox').numbox();
  },
  props:["num"],
  watch:{
      num:function(newval,oldval){
          mui('.mui-numbox').numbox().setOption('num',newval);
      }
  }
};
</script>
<style lang="scss" scoped>
</style>